package com.totoro.util;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Criterion;

/*
 * Criteria
 * 查询条件工具类
 */
public class ConditionQuery {

	// 查询条件Criterion列表
	private List<Criterion> criterions = new ArrayList<Criterion>();

	// 添加查询条件
	public void add(Criterion criterion) {
		criterions.add(criterion);
	}

	//构造查询条件Criteria
	public void build(Criteria criteria) {
		for (Criterion criterion : criterions) {
			criteria.add(criterion);
		}
	}

}
